<!--
	a mobileUser detail !
-->
<h3>添加课程</h3>
<div ng-controller="addCoursesCtrl" class="panel panel-default" style="overflow: hidden ">
    <div class="col-md-12">
        <form class="form-validate form-horizontal" name="updateForm" ng-submit="submitForm(updateForm.$valid)">
            <!-- START panel-->
            <div class="panel panel-default" style="border: none;">
                <div class="panel-heading">
                </div>
                <div class="panel-body">
                    <fieldset>
                        <div class="col-sm-4 form-inline">
                            <label class="pull-left" style="margin-right:10px;margin-top:7px" for="">{{courseClassificationSelectName}} : </label>
                            <select style="width: 200px;" class="custom-css form-control col-sm-8" ng-model="courseClassificationSelectValue"  name="courseClassificationSelectValue" ng-options="courseClassificationSelectValue._value_ for courseClassificationSelectValue in courseClassificationType" required></select>
                        </div>
                        <p class="redBorder" ng-if="updateForm.courseClassificationSelectValue.$error.required && updateForm.courseClassificationSelectValue.$touched">输入不能为空</p>
                    </fieldset>
                    <fieldset>
                        <div class="col-sm-4 form-inline">
                            <label class="pull-left" style="margin-right:10px;margin-top:7px" for="">{{classLabelSelectName}} : </label>
                            <select style="width: 200px;" class="custom-css form-control col-sm-8" ng-model="realmListSelectValue"  name="realmListSelectValue" ng-options="realmListSelectValue.name for realmListSelectValue in realmList" required></select>
                        </div>
                        <p class="redBorder" ng-if="updateForm.classLabelSelectValue.$error.required && updateForm.classLabelSelectValue.$touched">输入不能为空</p>
                    </fieldset>
                    <fieldset>
                        <div class="col-sm-4 form-inline">
                            <label class="pull-left" style="margin-right:10px;margin-top:7px" for="">{{signSelectName}} : </label>
                            <select style="width: 200px;" class="custom-css form-control col-sm-8" ng-model="signSelectValue"  name="signSelectValue" ng-options="signSelectValue._value_ for signSelectValue in signType" required></select>
                        </div>
                        <p class="redBorder" ng-if="updateForm.signSelectValue.$error.required && updateForm.signSelectValue.$touched">输入不能为空</p>
                    </fieldset>
                    <fieldset>
                        <div class="col-sm-4 form-inline">
                            <label class="pull-left" style="margin-right:10px;margin-top:7px" for="">计费方式 : </label>
                            <select style="width: 200px;" class="custom-css form-control col-sm-8" ng-model="billingWaySelectValue"  name="billingWaySelectValue" ng-options="billingWaySelectValue._value_ for billingWaySelectValue in billingWayType" required></select>
                        </div>
                    </fieldset>
                    <fieldset>
                        <div class="form-inline panel-heading">
                            是否上传小程序
                            <label style="margin:0 20px">
                                <input type="radio" name="optionsRadios"  value="1" ng-click="isTrue1()" ng-model="product.isApplet"  >
                                是
                            </label>
                            <label>
                                <input type="radio" name="optionsRadios"  value="0" ng-click="isTrue1()" ng-model="product.isApplet" ng-checked="1">
                                否
                            </label>
                        </div>
                    </fieldset>
                    <fieldset>
                        <div class="col-sm-4">
                            <input ng-maxlength="50" placeholder="标题" ng-model="product.name" name="name" type="text" class="form-control col-sm-4" required>
                        </div>
                        <p class="redBorder" ng-if="updateForm.name.$error.required && updateForm.name.$touched">输入不能为空</p>
                        <p class="redBorder" ng-if="updateForm.name.$error.maxlength && updateForm.name.$touched">输入长度不能大于50字节</p>
                    </fieldset>
                    <fieldset>
                        <div class="col-sm-3">
                            <input placeholder="用户手机号" name="phone" ng-model="product.phone" ng-change="userChange()" type="text" class="form-control" required>
                        </div>
                        <div class="col-sm-3">
                            <input placeholder="相应用户" ng-disabled="true" name="userName" ng-model="product.userName" type="text" class="form-control" required>
                        </div>
                        <p class="redBorder" ng-if="updateForm.phone.$error.required && updateForm.phone.$touched">输入不能为空</p>
                        <p class="redBorder" ng-if="updateForm.userName.$error.required">没有找到相应用户</p>
                    </fieldset>
                    <fieldset>
                        <div class="col-sm-4">
                            <input ng-maxlength="40" placeholder="头衔" name="label" ng-model="product.label" type="text" class="form-control col-sm-4" required>
                        </div>
                        <p class="redBorder" ng-if="updateForm.label.$error.required && updateForm.label.$touched">输入不能为空</p>
                        <p class="redBorder" ng-if="updateForm.label.$error.maxlength && updateForm.label.$touched">输入长度不能大于40字节</p>
                    </fieldset>
                    <fieldset>
                        <div class="col-sm-4">
                            <input ng-maxlength="50" placeholder="一句话简介" name="digest" ng-model="product.digest" type="text" class="form-control col-sm-4" required>
                        </div>
                        <p class="redBorder" ng-if="updateForm.digest.$error.required && updateForm.digest.$touched">输入不能为空</p>
                        <p class="redBorder" ng-if="updateForm.digest.$error.maxlength && updateForm.digest.$touched">输入长度不能大于50字节</p>
                    </fieldset>
                    <fieldset>
                        <div class="col-sm-6">
                            <textarea ng-maxlength="4000" placeholder="课程介绍" name="synopsis" ng-model="product.synopsis" class="form-control" required></textarea>
                        </div>
                        <p class="redBorder" ng-if="updateForm.synopsis.$error.required && updateForm.synopsis.$touched">输入不能为空</p>
                        <p class="redBorder" ng-if="updateForm.synopsis.$error.maxlength && updateForm.synopsis.$touched">输入长度不能大于4000字节</p>
                    </fieldset>
                    <fieldset>
                        <div class="col-sm-6">
                            <textarea ng-maxlength="2000" placeholder="适用人群" name="targeTusers" ng-model="product.targeTusers" class="form-control" required></textarea>
                        </div>
                        <p class="redBorder" ng-if="updateForm.targeTusers.$error.required && updateForm.targeTusers.$touched">输入不能为空</p>
                        <p class="redBorder" ng-if="updateForm.targeTusers.$error.maxlength && updateForm.targeTusers.$touched">输入长度不能大于2000字节</p>
                    </fieldset>
                    <fieldset>
                        <div class="col-sm-6">
                            <textarea ng-maxlength="2000" placeholder="作者介绍" name="authorInfo" ng-model="product.authorInfo" class="form-control" required></textarea>
                        </div>
                        <p class="redBorder" ng-if="updateForm.authorInfo.$error.required && updateForm.authorInfo.$touched">输入不能为空</p>
                        <p class="redBorder" ng-if="updateForm.authorInfo.$error.maxlength && updateForm.authorInfo.$touched">输入长度不能大于2000字节</p>
                    </fieldset>

                    <fieldset>
                        <div class="col-sm-2">
                            <input placeholder="金额" name="price" ng-model="product.price" type="text" class="form-control" required>
                        </div>
                        <p class="redBorder" ng-if="updateForm.price.$error.required && updateForm.price.$touched">输入不能为空</p>
                    </fieldset>
                    <fieldset>
                        <div class="col-sm-2">
                            <input ng-pattern="/^\d+$/" placeholder="虚拟数" name="basisData" ng-model="product.basisData" type="text" class="form-control" required>
                        </div>
                        <p class="redBorder" ng-if="updateForm.basisData.$error.required && updateForm.basisData.$touched">输入不能为空</p>
                        <p class="redBorder" ng-if="updateForm.basisData.$error.pattern && updateForm.basisData.$touched">输入需为正整数</p>
                    </fieldset>
                    <fieldset>
                        <div class="col-sm-2">
                            <span style="margin-top: 8px;display: inline-block; margin-left: 20px;"><input class="pull-left"  type="radio" class="form-control" name="sex" value="1" ng-model="product.status" required><span class="pull-left">上架</span></span>
                            <span style="margin-top: 8px;display: inline-block; margin-left: 20px;"><input class="pull-left"  type="radio" class="form-control" name="sex" value="2" ng-model="product.status" required><span class="pull-left">下架</span></span>
                        </div>
                    </fieldset>
                    <fieldset>
                        <div class="col-sm-2">
                            <span style="margin-top: 8px;display: inline-block; margin-left: 20px;"><input class="pull-left"  type="radio" class="form-control" name="updstatusN" value="1" ng-model="product.updstatus" required><span class="pull-left">完结</span></span>
                            <span style="margin-top: 8px;display: inline-block; margin-left: 20px;"><input class="pull-left"  type="radio" class="form-control" name="updstatusN" value="2" ng-model="product.updstatus" required><span class="pull-left">未完结</span></span>
                        </div>
                    </fieldset>
                    <fieldset class="text-center" ng-disabled="doNext">
                        <button class="btn btn-primary">下一步</button>
                    </fieldset>
                </div>
            </div>
            <!-- END panel-->
        </form>
    </div>
    <div class="col-md-12" ng-show="productId">
        <fieldset>
            <div>
                <img id="titleImg" style="height: 200px;width: 150px; line-height: 200px;text-align: center" class="img-thumbnail" src="" alt="app课程封面（300*400）">
            </div>
            <button id="titleBtn" style="margin-top: 20px;margin-left: 15px;" class="btn btn-primary">选择app封面图片</button>
        </fieldset>
        <fieldset>
            <div>
                <img id="contImg" style="height: 450px;width: 621px; line-height: 450px;text-align: center" class="img-thumbnail" src="" alt="app配图（900*635）">
            </div>
            <button id="contBtn" style="margin-top: 20px;margin-left: 240px;" class="btn btn-primary">选择app配图</button>
        </fieldset>
        <fieldset ng-show="wxShow">
            <div>
                <img id="titleImgWx" style="height: 180px;width: 180px; line-height: 200px;text-align: center" class="img-thumbnail" src="" alt="小程序课程封面（180*180）">
            </div>
            <button id="titleBtnWx" style="margin-top: 20px;margin-left: 15px;" class="btn btn-primary">选择小程序封面图片</button>
        </fieldset>
        <fieldset ng-show="wxShow">
            <div>
                <img id="contImgWx" style="height: 400px;width: 690px; line-height: 450px;text-align: center" class="img-thumbnail" src="" alt="配图（690*400）">
            </div>
            <button id="contBtnWx" style="margin-top: 20px;margin-left: 240px;" class="btn btn-primary">选择小程序配图</button>
        </fieldset>
        <fieldset class="text-center">
            <button class="btn btn-success" ng-click="createCoursesTitle(); createCoursesCont();createCoursesTitleWx(); createCoursesContWx()">确认生成课程</button> &nbsp; &nbsp;(课程生成后方可编辑课时)
        </fieldset>
    </div>
</div>